﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using CMD_WEB.DAL;

namespace CMD.BAL.SOL
{
    [DataContractAttribute]
    public class DeleteWeb
    {
        [DataMemberAttribute(EmitDefaultValue = false)]
        public string aIdWeb;
        public static CMD.BAL.MISC.DeleteStateMsg DeleteSolicitudWeb(string[] aIdWeb)
        {
            CMD.BAL.MISC.DeleteStateMsg delete;
            //convirto
            string join;
            if (aIdWeb == null)
            {
                join = "";
            }
            else
            {
                join = String.Join(", ", aIdWeb);

            }
            //ejecuto el store
            try 
        	{

                int dt = CMD_WEB.DAL.SrvDB.ExecuteNonQuery("exec SP_CMD_DELETE_SOL'" + join + "'");
                delete = new MISC.DeleteStateMsg("registros eliminados " + dt.ToString(),true);
                return delete;
	        }
	        catch (Exception ex)
	        {
               delete = new MISC.DeleteStateMsg("error al eliminar" + ex, false);
		    return delete;
	        }
        }
        public DeleteWeb() 
        {
            aIdWeb="";
        }
        public DeleteWeb(string aIdWeb)
        {
            this.aIdWeb = aIdWeb;
        }
    }
}
